// src/pages/404.js
import React from 'react'
import Article from '../templates/article'

export default function NotFound ({location}) {
    const pathname = location.pathname
    if (pathname.startsWith('/article')) {
        // 如果是以 /article 开头则返回 Article 组件并传递 slug
        const slug = pathname.substr(9)
        return <Article slug={slug} />
    }
    return <div></div>
}